Skip to content

feat: add firebase 12 support #199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cabljac
Copy link
Collaborator

@cabljac cabljac commented Aug 4, 2025

The Firebase Data Connect SDK generator has a hardcoded behavior where it determines the import
paths in generated files (like READMEs and package.json) based on the connector ID pattern.
Specifically:

  1. The generator expects a specific pattern: When the connector ID follows the format
    default-connector-, it generates import paths as @dataconnect/default-connector-
  2. Our initial attempt failed: We tried using a custom connector ID like v11 with a package name of
    @dataconnect/default-connector-v11, but the generator ignored our package configuration and
    generated imports as @dataconnect/v11 instead
  3. The workaround: By creating two connectors with IDs default-connector-v11 and
    default-connector-v12, the generator correctly produces import paths that match our desired package
    names

Why This Matters

  • Type Safety: Firebase 11 and 12 have different TypeScript types for Data Connect operations
  • Monorepo Compatibility: Angular needs to stay on Firebase 11 (due to @angular/fire compatibility),
    while React can support both 11 and 12
  • Clean Architecture: Rather than runtime version detection (which causes build issues), having
    separate static connectors ensures type safety at compile time

The Solution

We duplicated the GraphQL schema but configured each connector to:

  • Generate into separate packages (@dataconnect/default-connector-v11 and
    @dataconnect/default-connector-v12)
  • Reference the appropriate Firebase version in their peer dependencies
  • Maintain identical functionality while ensuring version-specific type compatibility

Copy link

changeset-bot bot commented Aug 4, 2025

⚠️ No Changeset found

Latest commit: 7549336

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

docs-page bot commented Aug 4, 2025

To view this pull requests documentation preview, visit the following URL:

docs.page/invertase/tanstack-query-firebase~199

Documentation is deployed and generated using docs.page.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @cabljac, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

I've implemented support for Firebase v12 within the Data Connect SDKs, while ensuring backward compatibility with Firebase v11. This involved generating separate SDK packages for each Firebase version and updating the project's dependency management to accommodate both. A new script has also been added to streamline the generation process for these multi-version SDKs.

Highlights

  • Firebase v12 Integration: Introduced dedicated Data Connect SDKs for Firebase v12, enabling projects to leverage the latest Firebase features.
  • Continued Firebase v11 Support: Created separate Data Connect SDKs for Firebase v11, ensuring existing applications can continue to function without disruption.
  • Automated SDK Generation: Added a new shell script (generate-connectors.sh) to automate the process of generating Data Connect SDKs for both Firebase v11 and v12, improving developer workflow.
  • Refined Dependency Management: Updated package.json and pnpm-lock.yaml to define and manage Firebase v11 and v12 as distinct peer dependencies using pnpm catalogs, allowing for flexible versioning.
  • Package Adaptations: Modified the Angular and React packages to correctly import and utilize the version-specific Data Connect SDKs, adapting their build configurations and dependencies.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for Firebase v12 by generating separate SDKs for both v11 and v12, which is a solid approach. The configuration files and dependencies have been updated accordingly, and the new script for generating connectors is a great addition for maintainability. However, I've identified some issues in the generated README files where the import paths are incorrect, which could mislead developers using these SDKs. Please address the suggested changes in the review comments.

@cabljac cabljac force-pushed the @invertase/bump-firebase-version branch from f840625 to 3324678 Compare August 4, 2025 13:39
@cabljac cabljac marked this pull request as ready for review August 4, 2025 13:44
@Copilot Copilot AI review requested due to automatic review settings August 4, 2025 13:44
Copilot

This comment was marked as outdated.

@cabljac cabljac force-pushed the @invertase/bump-firebase-version branch from 5d6f57b to 2eeea30 Compare August 4, 2025 13:57
@cabljac cabljac requested a review from Copilot August 4, 2025 13:58
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds Firebase 12 support alongside the existing Firebase 11 compatibility. The implementation creates separate connector configurations for each Firebase version while maintaining backward compatibility through version-specific SDKs and workspace catalogs.

  • Creates version-specific data connectors (v11 and v12) with identical GraphQL schemas
  • Adds pnpm workspace catalogs to manage Firebase version dependencies
  • Updates package peer dependencies to support both Firebase 11 and 12

Reviewed Changes

Copilot reviewed 26 out of 31 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pnpm-workspace.yaml Adds Firebase version catalogs for dependency management
packages/react/package.json Updates peer dependencies to support Firebase 11 and 12
packages/angular/package.json Switches to Firebase 11 catalog dependency
dataconnect/dataconnect.yaml Configures multiple connector directories for version support
dataconnect/connector-v11/ Creates Firebase 11 specific connector configuration
dataconnect/connector-v12/ Creates Firebase 12 specific connector configuration
dataconnect-sdk/js/default-connector-v11/ Generated SDK for Firebase 11 connector
dataconnect-sdk/js/default-connector-v12/ Generated SDK for Firebase 12 connector
scripts/generate-connectors.sh Adds script for generating Data Connect SDKs
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

dataconnect-sdk/js/default-connector-v12/package.json:23

  • The peer dependencies specify Firebase ^12.0.0 in the PR title and workspace catalogs, but this package.json only includes versions up to ^11.3.0. This should include ^12.0.0 to match the connector-v12 purpose.
    "firebase": "^10.14.0 || ^11.3.0"

@cabljac cabljac force-pushed the @invertase/bump-firebase-version branch from 6d11118 to 7549336 Compare August 4, 2025 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant